home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 23 / Amiga Format AFCD23 (Feb 1998, Issue 107).iso / +look_here_1st!+ / handy_tools / diskmasterii / rexx / assignlist.rexx next >
OS/2 REXX Batch file  |  1997-07-31  |  2KB  |  73 lines

  1. /*
  2. ** AssignList.rexx - DiskMaster utility to get assign an create
  3. ** new command window which contains a listing of all
  4. ** mounted volumes and assigns.
  5. ** The list will appear as a new CMD window.
  6. ** When you click on any items in the list a new DM window will open
  7. ** with a listing of the directory for the selected device or assign.
  8. ** Makes it easier to navigate through you hard drive system.
  9. ** You may also add additional devices which may not show up in
  10. ** the lists produced by ARexx's showlist() function.
  11. **
  12. ** Steven D. Kapplin - CIS 70055,1021 8/16/91
  13. */
  14.  
  15. if ~show('L','rexxsupport.library') then
  16.    call addlib('rexxsupport.library',0,-30)
  17.  
  18. address DM
  19.  
  20. temp1 = showlist('assigns')
  21. temp2 = showlist('volumes')
  22. temp = temp2 || ' ' || temp1
  23.  
  24. AList.0 = words(temp)
  25. do i = 1 to AList.0
  26.     AList.i = trim(word(temp,i))
  27. end
  28.  
  29. BarFormat '"Sorting Volume List ... "'
  30.  
  31. call sort(AList.0)
  32.  
  33. BarFormat '"Displaying Volume List ... "'
  34.  
  35. openwindow 282 12 92 191 CMD
  36.  
  37. /* Insert additional AddCmd instructions here to include    */
  38. /* additional devices which you want to show up.            */
  39.  
  40. AddCmd "DF0:,30,OpenWindow 358 210 224 131 DF0:"
  41. AddCmd "KF0:,30,External c:DiskChange KF0:;OpenWindow 358 210 224 131 KF0:"
  42.  
  43. do i = 1 to AList.0
  44.  
  45.     AddCmd ''AList.i || ":"',30,OpenWindow 358 210 224 131 'AList.i || ":"''
  46.  
  47. end
  48.  
  49. BarFormat '"DM 2.0 %D %M %Y Chip:%C Fast:%P"'
  50.  
  51. exit
  52.  
  53. /* CombSort subroutine */
  54. sort: procedure
  55.     arg A.0
  56.     switch = 1
  57.     size = A.0
  58.     gap = size
  59.     DO UNTIL (switch=0) & (gap=1)
  60.           gap = MAX(TRUNC(gap/1.3),1)
  61.           switch = 0
  62.           DO i = 1 TO size - gap
  63.                 j = i + gap
  64.                 IF (a.i>a.j) THEN DO
  65.                   hold = A.i
  66.                   a.i = a.j
  67.                   a.j = hold
  68.                   switch = switch + 1
  69.               END
  70.             END
  71.       END
  72. return
  73.